package com.hightrast.service.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hightrast.service.api.entity.RastProductVariants;
import com.hightrast.service.mapper.RastProductVariantsMapper;
import com.hightrast.service.service.IRastProductVariantsService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collectors;

/**
 * <p>
 * 商品变体表 服务实现类
 * </p>
 *
 * @author hx
 * @since 2025-01-22
 */
@Service
@Slf4j
public class RastProductVariantsServiceImpl extends ServiceImpl<RastProductVariantsMapper, RastProductVariants> implements IRastProductVariantsService {


    @Override
    public List<String> queryVariantsTitle() {
        return this.list().stream().map(RastProductVariants::getTitle).filter(StringUtils::isNotEmpty).distinct().collect(Collectors.toList());
    }
}
